<%--
  Created by IntelliJ IDEA.
  User: lyc
  Date: 2017/9/18
  Time: 22:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script>
        function undownload() {
            var params = ["1"];
            $.get("http://localhost:8080/undownload", {"ids": params});
        }

        function download() {
            var params = ["1"];

            $.post("http://localhost:8080/download", {"ids": params}, function (response) {
                window.open(response.toString());
            }, "json");
        }
    </script>
</head>
<body>
<input type="button" value="无法下载文件" onclick="undownload()"/>
<input type="button" value="下载文件" onclick="download()"/>
</body>
</html>
